package com.heima.kafka.web;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author jack
 * @data 2024 10:10
 */
@Component
public class HelloListener {

    @KafkaListener(topics = "hello-topic")
    public void listen(ConsumerRecord record){
        System.out.println(record.key());
        System.out.println(record.value());
    }
}
